﻿using System;
using DataAccess.Accessors.Interfaces;
using DataAccess.Interfaces;
using NHibernate;

namespace DataAccess.Accessors
{
    public class DataAccessor : IDataAccessor
    {
        private readonly INHibernateSessionProvider _nHibernateSessionProvider;

        public DataAccessor(INHibernateSessionProvider nHibernateSessionProvider)
        {
            _nHibernateSessionProvider = nHibernateSessionProvider;
        }

        public ISession OpenNHibernateSession()
        {
            return _nHibernateSessionProvider.OpenNHibernateSession();
        }
    }
}
